<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">



<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Projetos</title>
</h:head>

<h:body>


	<p:growl id="aviso" />

	<h:form id="cabecalho">

		<h:panelGrid columns="1" cellpadding="3">


			<p:commandButton id="modalDialogButton" value="Novo Projeto"
				action="#{funcionario.novo}" onclick="inserirDialog.show()"
				type="button" icon="ui-icon-extlink" />

		</h:panelGrid>



	</h:form>







	<!-- Form utilizado para inserir um novo projeto -->




	<h:form id="formInserir" prependId="false">

		<p:dialog id="modalDialog" header="Novo Projeto"
			widgetVar="inserirDialog" modal="true">



			<h:panelGrid id="panel" columns="4">




				<h:outputLabel value="Tipo: *" for="projeto"></h:outputLabel>




				<p:selectOneMenu id="tipo" value="#{projeto.projetoPOJO.tipo}">
					<f:selectItem itemLabel=" " itemValue=" " />
					<f:selectItem itemLabel="Projeto" itemValue="Projeto" />
					<f:selectItem itemLabel="Tarifa" itemValue="Tarifa" />
					<f:selectItem itemLabel="Evolutivo" itemValue="Evolutivo" />

					<f:validateLength minimum="4">
					</f:validateLength>
				</p:selectOneMenu>





				<h:outputLabel value="PSI: *" for="psi"></h:outputLabel>
				<p:inputText id="psi" value="#{projeto.projetoPOJO.psi}"
					required="true" label="psi">
					<f:validateLength minimum="4" />
				</p:inputText>


				<h:outputLabel value="Nome: *" for="nome"></h:outputLabel>

				<p:inputText id="nome" value="#{projeto.projetoPOJO.nome}"
					required="true" label="nome">
					<f:validateLength minimum="10" />
				</p:inputText>


				<h:outputLabel value="Empresa *" for="empresa"></h:outputLabel>
				<p:selectOneMenu id="empresa" value="#{projeto.projetoPOJO.empresa}">
					<f:selectItem itemLabel=" " itemValue=" " />
					<f:selectItem itemLabel="Porto Seguro" itemValue="Porto Seguro" />
					<f:selectItem itemLabel="Azul Seguros" itemValue="Azul Seguros" />
					<f:selectItem itemLabel="Itaú - Isar" itemValue="Itaú Isar" />

					<f:validateLength minimum="4">
					</f:validateLength>
				</p:selectOneMenu>
			</h:panelGrid>


			<h:panelGrid columns="1" id="panelDesc">


				<h:outputLabel value="Descrição *" for="descricao"></h:outputLabel>

			</h:panelGrid>

			<h:panelGrid columns="1" >


				<p:inputTextarea value="#{projeto.projetoPOJO.descricao}"  rows="7" cols="70" maxlength="200" 
					autoResize="false" id="descricao" />


			</h:panelGrid>
			
			
			
			<div align="center">
			
			<h:panelGrid columns="4" cellpadding="10">
			
			<h:outputLabel value="Data Inicio: *" for="dataInicio"></h:outputLabel> 
			
			<p:calendar value="#{projeto.projetoPOJO.datainicio}" id="dataInicio" size="6"></p:calendar>
			
			
			<h:outputLabel value="Data Fim: *" for="dataInicio"></h:outputLabel>
			
 			<p:calendar value="#{projeto.projetoPOJO.datafim}" id="datafim" size="6"></p:calendar>
			
			</h:panelGrid>
			
			
			</div>

			<p:commandButton action="#{projeto.inserirProjeto}" value="Inserir"
				update="formInserir">


			</p:commandButton>

			<p:commandButton oncomplete="inserirDialog.hide()" value="Fechar"
				onclick="form.reset()">

			</p:commandButton>




		</p:dialog>


	</h:form>






</h:body>
</html>